﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.TR.Bussiness;
using ZX.TR.Library;

namespace ZX.TR.Web
{
    public partial class QuestionnaireSubjectEdit : System.Web.UI.Page
    {
        BTrQuestionnaireSubject bt = new BTrQuestionnaireSubject();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                QuestionnaireSubjectId = this.Request.QueryString["id"];
                this.hiddenId.Value = QuestionnaireSubjectId;
                V_TrQuestionnaireSubject listInfo = bt.GetQuestionnaireSubjectInfo(new Guid(QuestionnaireSubjectId));
                if (listInfo != null)
                {
                    this.lblQName.Text = listInfo.QuestionnaireName;
                    this.lblSName.Text = listInfo.SubjectContent;
                    this.txtSeq.Text = listInfo.Sequence.ToString();
                    this.txtNumber.Text = listInfo.SubjectPoint.ToString();
                    string strJump = listInfo.IsJumpOver;
                    if (strJump == "N")
                    {
                        this.drpJump.SelectedIndex = 1;
                        this.hiddenJump.Value = "N";
                    }
                    else
                    {
                        this.drpJump.SelectedIndex = 0;
                        this.hiddenJump.Value = "Y";
                    }
                }
            }
        }
        public string QuestionnaireSubjectId
        { get; set; }

        protected void drpJump_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.drpJump.SelectedValue == "Y")
            {
                this.hiddenJump.Value = "Y";
            }
            else
            {
                this.hiddenJump.Value = "N";
            }
        }
    }
}